<div class="bh-ly-jj-zhuce bh-padT10 bh-content">
	<div class="bh-page-index-jj">
		<div class="bh-zhhmm-xf">
			<?php echo $this->renderPartial('application.views.partials.order.schedule');?>
		</div>
	</div>
</div>

<div class='p-w l-lr'><div class='p-i-w'>

	<div class='l-box l-l'>
		<div class='sb-w '>
			<h1 class='sb-title'><span>商品信息</span></h1>			
			<div class='sb-ci-w gc-g-w'>
				<!-- 200x130 -->
				<div class='gc-g-img-w'>
					<a href='<?php echo $this->createUrl('nativeView',array('id'=>CHtml::value($model, 'items.goods_id')))?>' target='_bank'><?php echo empty($model->items->goods) ? '' : $model->items->goods->img(130,130)?></a>
				</div>
				<div class='gc-g-desc-w font-body'>
					<p>
						<span class='fc-666'>商品名称：</span>
						<a class='a-blue' href='<?php echo $this->createUrl('nativeView',array('id'=>CHtml::value($model, 'items.goods_id')))?>' target='_bank'><?php echo CHtml::value($model, 'items.goods.fullTitle')?></a>
					</p>
					<p>
						<span class='fc-666'>销售价：</span><span class='fc-red bh-strong'>￥<?php echo intval(CHtml::value($model, 'items.goods.priceInfo.price_dealer'))?></span>
					</p>
					<p><span class='fc-666'>评论数：</span><?php echo GoodsComment::model()->countByAttributes(array('target_object_type'=>'Native','target_object_id'=>CHtml::value($model, 'items.goods_id')))?>条</p>
				</div>
			</div>
		</div>
	</div>
	
	<div class='l-box l-r'>
		<div class="fieldset">
			<?php $form = $this->beginWidget('lib.widgets.CActiveFormAdv')?>
    		<?php echo $form->hiddenField($model,'items.related_id')?>
    		<?php echo $form->hiddenField($model,'items.goods_id')?>
    		<?php echo $form->hiddenField($model,'items.provider_id')?>
    		<?php echo $form->hiddenField($model,'items.dealer_id')?>
    		<?php echo $form->hiddenField($model,'items.item_price',array('id'=>'price'))?>
			<div class="fieldset-title"><h2><span>填写订单信息</span></h2></div>
			<div class="fieldset-content">
				<table width="100%" class="form-tb largespacing">
					<tbody>
						<tr><th width=100><span class="required">*</span>土特产名字：</th><td class="bh-strong"><?php echo CHtml::value($model, 'items.goods.fullTitle')?></td></tr>
						<tr class='cell-borderb'>
							<th><span class="required">*</span>预订数量：</th>
							<td><?php echo $form->dropDownList($model, 'items.item_num',Yii::app()->enum->options('num',false), array('id'=>'item-num'))?>
								<?php echo $form->error($model, 'items.item_num');?>
							</td>
						</tr>
						<tr>
							<th class="bh-strong-ipt bh-font14">订单金额：</th>
							<td class="font-clr bh-font24 bh-strong">
								<span class="bh-font12">&yen;</span>
								<label id="money"><?php echo CHtml::value($model, 'items.item_price')?></label>
							</td>
						</tr>
					</tbody>
				</table>
			</div>
		</div>
		
		<div class="fieldset">
			<div class="fieldset-title"><h2><span>填写订购人信息</span></h2></div>
			<div class="fieldset-content">
				<table width="100%" class="form-tb largespacing">
					<tbody>
						<tr width=100>
							<th><span class="required">*</span>支付类型：</th>
							<td> <?php echo $form->dropDownList($model, 'pay_type',Yii::app()->enum->options('order.payType'))?>
								<?php echo $form->error($model, 'pay_type');?>
							</td>
						</tr>
						<tr>
							<th width=100><span class="required">*</span>订购人：</th>
							<td>
								<?php echo $form->textField($model,'receiverInfo.receiver')?>
								<?php echo $form->error($model, 'receiverInfo.receiver')?>
							</td>
						</tr>
						<tr>
							<th><span class="required">*</span>订购人手机：</th>
							<td>
								<?php echo $form->textField($model,'receiverInfo.mobile')?>
								<?php echo $form->error($model, 'receiverInfo.mobile')?>
							</td>
						</tr>
						<tr>
							<th><span class="required">*</span>所在地区：</th>
							<td>
								<?php 
                                	$ls=$form->linkage('district');
                                	echo $ls->dropDownList($model,'receiverInfo.province',1);
                                	echo $ls->dropDownList($model,'receiverInfo.city',2);
                                	echo $ls->dropDownList($model,'receiverInfo.district',3);
                              	?>
								<?php echo $form->error($model, 'receiverInfo.district')?>
							</td>
						</tr>
						<tr>
							<th><span class="required">*</span>街道地址：</th>
							<td>
								<?php echo $form->textField($model,'receiverInfo.address')?>
								<?php echo $form->error($model, 'receiverInfo.address')?>
							</td>
						</tr>
						<tr>
							<th>邮箱：</th>
							<td class="bh-strong">
								<?php echo $form->textField($model,'receiverInfo.email')?>
								<?php echo $form->error($model, 'receiverInfo.email')?>
							</td>
						</tr>
						<tr>
							<th valign=top>备注：</th>
							<td>
								<?php echo $form->textArea($model,'remark',array(
										'rows'=>'3',
										'cols' => '100',
									))?>
								<?php echo $form->error($model, 'remark')?>
							</td>
						</tr>
					</tbody>
				</table>
			</div>
		</div>
	</div>
	
	<div align="center">
		<input class="bh-lr-btn" type="submit" name="yt0" value="提交订单">
	</div>
	<?php $this->endWidget();?>
	<div class='bh-clear'></div>
</div></div>
<script>
$('#item-num').change(function () {
	$('#money').html($('#price').val()*$(this).val());
});
</script>